package com.dy.course.enumerate;

public enum MeetingStatus {

	NEW(0, "新建"), PROCESSING(1, "进行中"), FINISHED(2, "已完成");

	private Integer code;
	private String desc;

	private MeetingStatus(Integer code, String desc) {
		this.code = code;
		this.desc = desc;
	}

	public Integer getCode() {
		return this.code;
	}

	public String getDesc() {
		return this.desc;
	}
	
	public static String getDesc(Integer code) {
		MeetingStatus[] mses = MeetingStatus.values();
		for (MeetingStatus ms : mses) {
			if (ms.getCode() == code) {
				return ms.getDesc();
			}
		}
		return null;
	}

	public static boolean isCorrent(Integer code) {
		String desc = getDesc(code);
		return desc != null;
	}
}
